﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Win32;

namespace ATMCommon.ATMConfig
{
    public enum ATMConfigTypeEnum
    {
        Registry,
        XML
    }

    public static class BasicConfig
    {
        public static ATMConfigTypeEnum GetATMConfigType()
        {
            object regValue = null;
            RegistryValueKind kind = RegistryValueKind.Unknown;


            if (ATMCommonLib.RegCommon.GetRegValue(Registry.LocalMachine,
                "Software\\SOFTWARE\\LittleATM\\BasicConfig", "ATMConfigType", out kind, out regValue))
            {
                if (kind == RegistryValueKind.String)
                {
                    if (regValue.ToString().Equals("Registry", StringComparison.OrdinalIgnoreCase))
                    {
                        return ATMConfigTypeEnum.Registry;
                    }
                }
            }

            return ATMConfigTypeEnum.XML;
        }
    }
}
